from django.shortcuts import render, reverse
from django.http import HttpResponse


# Create your views here.


# /users/sayhello
def say_hello(request):
    return HttpResponse('say_hello')


# /users/say
def say(request):
    return HttpResponse('say')


#  http://127.0.0.1:8000/users/index/?a=10&b=20
def index(request):
    """
    django标准函数视图  两个要求 必须要有一个参数来接收请求对象,必须在函数的最后响应了一个HttpResponse
    :param request: 接收到请求  HttpRequest/WsgiRequest
    :return: HttpResponse() 响应对象 不能直接返回字符串
    """

    print(reverse('users:index'))
    print("-------")
    return HttpResponse('hello world')
